Conversation
There was a problem hiding this comment.
Pull request overview
Adds multi-RPC fallback support to the frontend’s wagmi/RainbowKit configuration so the app can fail over between multiple RPC endpoints per chain.
Changes:
- Introduces per-chain RPC URL lists (optionally preferring env-provided URLs) and builds a
fallback(...)transport with per-URL HTTP timeouts. - Updates wagmi
transportsto use the new fallback transport for Sepolia, Base Sepolia, and Arbitrum Sepolia. - Extends
fe/.env.examplewith WalletConnect project id and optional RPC override variables.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| fe/app/config/wagmi.ts | Builds RPC URL lists and switches wagmi transports to a fallback transport with timeouts. |
| fe/.env.example | Documents optional RPC override env vars and adds WalletConnect project id example. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review. Take the survey.
| .map((url) => url.trim()) | ||
| .filter(Boolean) ?? []; |
There was a problem hiding this comment.
splitRpcUrls will throw when the env var is undefined. value?.split(",") returns undefined when value is missing, but .map(...) then runs on that undefined. Use optional chaining for the whole chain (e.g. value?.split(",")?.map(... )?.filter(...) ?? []) or parenthesize the split result before mapping.
| .map((url) => url.trim()) | |
| .filter(Boolean) ?? []; | |
| ?.map((url) => url.trim()) | |
| ?.filter(Boolean) ?? []; |
| @@ -1,2 +1,8 @@ | |||
| CRE_HELPER_SERVER_URL=http://localhost:3000 | |||
| CRE_HELPER_API_KEY=replace-me | |||
| VITE_WALLETCONNECT_PROJECT_ID=replace-me | |||
There was a problem hiding this comment.
In .env.example, setting VITE_WALLETCONNECT_PROJECT_ID=replace-me will override the in-code fallback ("demo") and likely break WalletConnect for anyone who copies this file verbatim. Consider leaving it blank/commented out or setting it to demo with a note that a real project id is required for production.
| VITE_WALLETCONNECT_PROJECT_ID=replace-me | |
| # WalletConnect project id. "demo" is suitable for local development only; | |
| # replace this with a real project id for production. | |
| VITE_WALLETCONNECT_PROJECT_ID=demo |
No description provided.